package com.example.demo.mapper;

import com.example.demo.model.ProductModel;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Create by keboom on 2020/7/3
 */
@Mapper
public interface ProductMapper {

    @Select("select * from product")
    List<ProductModel> selectAll();

    @Insert("insert into product(productPicture,productTitle,productContent,productPrice) values (#{productPicture},#{productTitle},#{productContent},#{productPrice})")
    @Options(useGeneratedKeys = true,keyProperty = "productId",keyColumn = "productId")
    int insertPoduct(ProductModel productModel);
}
